package biolabs.model

import biolabs.model.division.DivisionDelegate

/**
 * Trait of a bio-object that maintains a cumulation state.
 *
 * @author Tomas Mikula
 */
trait CumulationStateful[Self <: CumulationStateful[Self, P], P]
{

	protected var cumulationState: Any = null

	protected def init(cumulationState: Any) {
		this.cumulationState = cumulationState
	}

	def handleDivision(dd: DivisionDelegate[P, Self]) {
		dd.daughter().cumulationState = cumulationState
	}

}